<%@include file="parts/Header.jsp" %>
<%--
    Document   : About Us
    Created on : 16/08/2011, 11:47:35 ص
    Author     : Ahmed
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>About Us-Admin</title>

        <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" />
        <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
        <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>

        <script>
            $(function() {
                $( "#accordion" ).accordion({
                    event: "click hoverintent",
                    heightStyle: "content"
                });
            });
 
            var cfg = ($.hoverintent = {
                sensitivity: 7,
                interval: 100
            });
 
            $.event.special.hoverintent = {
                setup: function() {
                    $( this ).bind( "mouseover", jQuery.event.special.hoverintent.handler );
                },
                teardown: function() {
                    $( this ).unbind( "mouseover", jQuery.event.special.hoverintent.handler );
                },
                handler: function( event ) {
                    var that = this,
                    args = arguments,
                    target = $( event.target ),
                    cX, cY, pX, pY;
 
                    function track( event ) {
                        cX = event.pageX;
                        cY = event.pageY;
                    };
                    pX = event.pageX;
                    pY = event.pageY;
                    function clear() {
                        target
                        .unbind( "mousemove", track )
                        .unbind( "mouseout", arguments.callee );
                        clearTimeout( timeout );
                    }
                    function handler() {
                        if ( ( Math.abs( pX - cX ) + Math.abs( pY - cY ) ) < cfg.sensitivity ) {
                            clear();
                            event.type = "hoverintent";
                            // prevent accessing the original event since the new event
                            // is fired asynchronously and the old event is no longer
                            // usable (#6028)
                            event.originalEvent = {};
                            jQuery.event.handle.apply( that, args );
                        } else {
                            pX = cX;
                            pY = cY;
                            timeout = setTimeout( handler, cfg.interval );
                        }
                    }
                    var timeout = setTimeout( handler, cfg.interval );
                    target.mousemove( track ).mouseout( clear );
                    return true;
                }
            };
        </script>


        <script src="styles/html/ckeditor.js"></script>
        <link href="styles/html/sample.css" rel="stylesheet">
        <script>

            // The instanceReady event is fired, when an instance of CKEditor has finished
            // its initialization.
            CKEDITOR.on( 'instanceReady', function( ev ) {
                // Show the editor name and description in the browser status bar.
                document.getElementById( 'eMessage' ).innerHTML = 'Instance <code>' + ev.editor.name + '<\/code> loaded.';

                // Show this sample buttons.
                document.getElementById( 'eButtons' ).style.display = 'block';
            });

            function InsertHTML() {
                // Get the editor instance that we want to interact with.
                var editor = CKEDITOR.instances.editor1;
                var value = document.getElementById( 'htmlArea' ).value;

                // Check the active editing mode.
                if ( editor.mode == 'wysiwyg' )
                {
                    // Insert HTML code.
                    // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertHtml
                    editor.insertHtml( value );
                }
                else
                    alert( 'You must be in WYSIWYG mode!' );
            }

            function InsertText() {
                // Get the editor instance that we want to interact with.
                var editor = CKEDITOR.instances.editor1;
                var value = document.getElementById( 'txtArea' ).value;

                // Check the active editing mode.
                if ( editor.mode == 'wysiwyg' )
                {
                    // Insert as plain text.
                    // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertText
                    editor.insertText( value );
                }
                else
                    alert( 'You must be in WYSIWYG mode!' );
            }

            function SetContents() {
                // Get the editor instance that we want to interact with.
                var editor = CKEDITOR.instances.editor1;
                var value = document.getElementById( 'htmlArea' ).value;

                // Set editor contents (replace current contents).
                // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-setData
                editor.setData( value );
            }

            function GetContents() {
                // Get the editor instance that you want to interact with.
                var editor = CKEDITOR.instances.editor1;

                // Get editor contents
                // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData
                alert( editor.getData() );
            }

            function ExecuteCommand( commandName ) {
                // Get the editor instance that we want to interact with.
                var editor = CKEDITOR.instances.editor1;

                // Check the active editing mode.
                if ( editor.mode == 'wysiwyg' )
                {
                    // Execute the command.
                    // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-execCommand
                    editor.execCommand( commandName );
                }
                else
                    alert( 'You must be in WYSIWYG mode!' );
            }

            function CheckDirty() {
                // Get the editor instance that we want to interact with.
                var editor = CKEDITOR.instances.editor1;
                // Checks whether the current editor contents present changes when compared
                // to the contents loaded into the editor at startup
                // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-checkDirty
                alert( editor.checkDirty() );
            }

            function ResetDirty() {
                // Get the editor instance that we want to interact with.
                var editor = CKEDITOR.instances.editor1;
                // Resets the "dirty state" of the editor (see CheckDirty())
                // http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-resetDirty
                editor.resetDirty();
                alert( 'The "IsDirty" status has been reset' );
            }

            function Focus() {
                CKEDITOR.instances.editor1.focus();
            }

            function onFocus() {
                document.getElementById( 'eMessage' ).innerHTML = '<b>' + this.name + ' is focused </b>';
            }

            function onBlur() {
                document.getElementById( 'eMessage' ).innerHTML = this.name + ' lost focus';
            }

        </script>


    </head>
    <body onload="resizePage()">
        <center>
            <div id="innerPageContainer" >
                <table style="width: 100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>

                        <td rowspan="3" id="innerPageCell" >

                            <div id="accordion">
                                <logic:iterate id="msg" name="AdminBean" property="aboutUs">
                                    <logic:notEqual name="msg" property="showMenu" value="null">
                                        <logic:notEqual name="msg" property="showMenu" value="no">

                                            <h3>${msg.aboutUsTerm}</h3>
                                            <div>
                                                <p>

                                                <table>
                                                    <html:form action="/admin.do?actionType=updateAboutUs">

                                                        <tr><td>Term</td><td><html:text name="msg" property="aboutUsTerm" value="${msg.aboutUsTerm}"/></td></tr>
                                                        <html:hidden name="msg" property="aboutUsId"  value="${msg.aboutUsId}"/>
                                                        <tr><td>AboutUs id</td><td>${msg.aboutUsId}</td></tr>
                                                        <tr><td> ShowMenu</td><td>
                                                                <html:select  name="msg"  property="showMenu" value="${msg.showMenu}">
                                                                    <html:option value="no">No</html:option>
                                                                    <html:option value="yes">Yes</html:option>
                                                                </html:select>
                                                            </td></tr>
                                                        <tr><td>Description</td><td>
                                                                <html:textarea  property="aboutUsDescription" cols="100" styleId="a${msg.aboutUsId}"  rows="10" value="${msg.aboutUsDescription}"/>

                                                                <script>
                                                                    // Replace the <textarea id="editor1"> with an CKEditor instance.
                                                                    CKEDITOR.replace( 'a2', {
                                                                        on: {
                                                                            
                                                                            focus: onFocus,
                                                                            blur: onBlur,

                                                                            // Check for availability of corresponding plugins.
                                                                            pluginsLoaded: function( evt ) {
                                                                                var doc = CKEDITOR.document, ed = evt.editor;
                                                                                if ( !ed.getCommand( 'bold' ) )
                                                                                    doc.getById( 'exec-bold' ).hide();
                                                                                if ( !ed.getCommand( 'link' ) )
                                                                                    doc.getById( 'exec-link' ).hide();
                                                                            }
                                                                        }
                                                                    });
                                                                   
                                                                </script>

                                                                <script>
                                                                    // Replace the <textarea id="editor1"> with an CKEditor instance.
                                                                    CKEDITOR.replace( 'a3', {
                                                                        on: {
                                                                            focus: onFocus,
                                                                            blur: onBlur,

                                                                            // Check for availability of corresponding plugins.
                                                                            pluginsLoaded: function( evt ) {
                                                                                var doc = CKEDITOR.document, ed = evt.editor;
                                                                                if ( !ed.getCommand( 'bold' ) )
                                                                                    doc.getById( 'exec-bold' ).hide();
                                                                                if ( !ed.getCommand( 'link' ) )
                                                                                    doc.getById( 'exec-link' ).hide();
                                                                            }
                                                                        }
                                                                    });
                                                               
                                                                </script>
                                                                <script>
                                                                    // Replace the <textarea id="editor1"> with an CKEditor instance.
                                                                    CKEDITOR.replace( 'a4', {
                                                                        on: {
                                                                            focus: onFocus,
                                                                            blur: onBlur,

                                                                            // Check for availability of corresponding plugins.
                                                                            pluginsLoaded: function( evt ) {
                                                                                var doc = CKEDITOR.document, ed = evt.editor;
                                                                                if ( !ed.getCommand( 'bold' ) )
                                                                                    doc.getById( 'exec-bold' ).hide();
                                                                                if ( !ed.getCommand( 'link' ) )
                                                                                    doc.getById( 'exec-link' ).hide();
                                                                            }
                                                                        }
                                                                    });
                                                               
                                                                </script>



                                                            </td></tr>
                                                        <tr><td><html:submit value="update" style=" padding: 10px 15px;
                                                                     background: #4479BA;
                                                                     color: #FFF;
                                                                     -webkit-border-radius: 4px;
                                                                     -moz-border-radius: 4px;
                                                                     border-radius: 4px;
                                                                     border: solid 1px #20538D;
                                                                     width: 100px;
                                                                     text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
                                                                     -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
                                                                     -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
                                                                     box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
                                                                     -webkit-transition-duration: 0.2s;
                                                                     -moz-transition-duration: 0.2s;
                                                                     transition-duration: 0.2s;
                                                                     -webkit-user-select:none;
                                                                     -moz-user-select:none;
                                                                     -ms-user-select:none;
                                                                     user-select:none;"/></td><td></td></tr>
                                                            </html:form>
                                                </table>
                                                </p>
                                            </div>
                                        </logic:notEqual>
                                    </logic:notEqual>
                                </logic:iterate>
                            </div>



                        </td>
                    </tr>

                    <tr>

                        <td>

                        </td>
                    </tr>

                    <tr>
                        <td class="lastList">

                        </td>
                    </tr>

                    <tr>
                        <td colspan="2" class="footer">
                            <jsp:include page="parts/Footer.jsp"/>
                        </td>
                    </tr>
                </table>

            </div>








        </center>
    </body>
</html>

